<template>
  <view class="shop_container">
    <view class="list_box">
      <view
        style="
          border-bottom: 1rpx solid rgb(238, 238, 238);
          padding: 25rpx 0;
          background-color: #fff;
        "
        v-for="(item, index) in list"
        :key="index"
      >
        <u-row>
          <u-col
            span="3"
            @click="$utils.toUrl('/pages/shop/info?id=' + item.id)"
          >
            <image
              :src="item.logo"
              mode=""
              style="width: 120rpx; height: 120rpx; border-radius: 10rpx"
            ></image>
          </u-col>
          <u-col span="9">
            <view
              style="font-size: 32rpx; color: #333333"
              @click="$utils.toUrl('/pages/shop/info?id=' + item.id)"
              >{{ item.name }}</view
            >
            <view
              class=""
              @click="$utils.toUrl('/pages/shop/info?id=' + item.id)"
            >
              <u-rate :count="5" v-model="item.score" :disabled="true"></u-rate>
            </view>
            <view class="flex-x-sb flex-y-center">
              <view>
                <u-icon name="phone" size="30"></u-icon>
                <text
                  style="font-size: 24rpx; color: #666666; margin-left: 10rpx"
                  >{{ $t("common.phone") }} {{ item.tel }}</text
                >
              </view>
              <u-icon
                style="float: right"
                name="trash"
                color="#B2B2B2"
                size="40"
                class="u-close"
                @click.stop="remove(item.log_id, index)"
              ></u-icon>
            </view>
          </u-col>
        </u-row>
      </view>
      <view v-show="list.length == 0">
        <u-empty
          :text="$t('common.noRecord')"
          mode="history"
          style="background-color: rgb(246, 246, 246)"
        ></u-empty>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {};
  },
  methods: {
    async remove(id, index) {
      this.$emit("remove", id, index);
    },
  },
};
</script>

<style scoped lang="scss">
.shop_container {
  padding-top: 40rpx;
  background-color: rgb(246, 246, 246);
}
.list_box {
  padding: 20rpx;
}
</style>
